home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbauxmna.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-12-26  |  2.1 KB  |  67 lines

  1. (*===========================================================================*)
  2. (* AX25 call to string transform                                             *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989 by H. Roy Engehausen.  All rights reserved.        *)
  5. (*   This software may be freely distributed and used, but it may not        *)
  6. (*   under any circumstances be sold by anyone other than the author.        *)
  7. (*   It may be distributed by a commercial company as long as it is          *)
  8. (*   for no cost.                                                            *)
  9. (*                                                                           *)
  10. (*===========================================================================*)
  11.  
  12. (*===========================================================================*)
  13. (* AX25 call to string                                                       *)
  14. (*===========================================================================*)
  15.  
  16. FUNCTION ax25_call_to_string (this_call : ax25_call_ptr): bb_addr_str;
  17.  
  18.   VAR
  19.     i           : BYTE;
  20.     j           : BYTE;
  21.     out_string  : bb_addr_str;
  22.     ssid_string : STRING[3];
  23.  
  24.   BEGIN;
  25.  
  26.     WITH this_call^ DO
  27.       BEGIN;
  28.  
  29.         i := 0;
  30.  
  31.         WHILE (i < SIZEOF(call_sign)) AND (call_sign[i + 1] <> $40) DO
  32.           BEGIN;
  33.             INC(i);
  34.             out_string[i] := CHR(call_sign[i] SHR 1);
  35.           END;
  36.  
  37.         out_string[0] := CHR(i);
  38.  
  39.         i := (ssid AND $1E) SHR 1;
  40.  
  41.         IF i <> 0 THEN
  42.           BEGIN;
  43.  
  44.             IF i >= 10 THEN
  45.               BEGIN;
  46.                 ssid_string := '-10';
  47.                 i := i - 10;
  48.                 j := 3;
  49.               END
  50.             ELSE
  51.               BEGIN;
  52.                 ssid_string := '-0';
  53.                 j           := 2;
  54.               END;
  55.  
  56.             ssid_string[j] := byte_to_char[i];
  57.  
  58.             out_string := out_string + ssid_string;
  59.  
  60.           END;
  61.  
  62.       END;
  63.  
  64.     ax25_call_to_string := out_string;
  65.  
  66.   END;
  67.